<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateCrmWorkModifySignTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        //
        Schema::create('crm_work_modify_sign', function (Blueprint $table) {
            $table->engine='MyISAM';
            $table->comment='改打或补打 签到';
            $table->increments('id')->unsigned()->comment('自动增长主键');
            $table->integer('crm_uid')->unsigned()->default(0)->index('crm_uid')->comment('crm uid');
            $table->tinyInteger('category')->unsigned()->default(0)->comment('类别：1 改打，2 补打');
            $table->integer('modify_id')->unsigned()->default(0)->comment('要修改的打卡ID号');
            $table->string('sign_name',20)->comment('要修改的字段名字');
            $table->timestamp('time')->comment('时间');
            $table->integer('crm_reviewer_uid')->unsigned()->default(0)->index('crm_reviewer_uid')->comment('审核人uid');
            $table->tinyInteger('reviewer_status')->unsigned()->default(0)->comment('审核状态，0表示未审核，1表示审核通过');
            $table->timestamps();
            $table->unique(['crm_uid','created_at']);
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        //
        Schema::drop('crm_work_modify_sign');
    }
}
